<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>FarListItemData</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../../styles/styles.css">
<script language="javascript" src='../../links.js' type="text/javascript"></script>
</head>
<body>

<h1>FarListItemData</h1>
<div class=navbar>
<a href="../../index.html">main</a> |
<a href="../index.html">Dialog API</a><br>
</div>

<div class=shortdescr>
The <dfn>FarListItemData</dfn> structure describes the data that
will be associated with an item in a
<a href="../controls/di_listbox.html">DI_LISTBOX</a> or
<a href="../controls/di_combobox.html">DI_COMBOBOX</a> list.
</div>

<pre class=syntax>
struct FarListItemData
{
  int   Index;
  int   DataSize;
  void *Data;
  DWORD Reserved;
};
</pre>
<h3>Members</h3>
<div class=descr>
  <div class=dfn>Index</div>
  <div class=dfndescr>Index of the list item to which the data is associated.</div>

  <div class=dfn>DataSize</div>
  <div class=dfndescr>Size of <var>Data</var> or 0 if a null-terminated
    string is being associated with the item.</div>

  <div class=dfn>Data</div>
  <div class=dfndescr>Pointer to the data.</div>

  <div class=dfn>Reserved</div>
  <div class=dfndescr>Reserved.</div>
</div>

<h3>Remarks</h3>
<div class=descr>
Dialog manager allocates memory for the data associated with the list item using
the following rules:

<table class="cont">
<tr class="cont"><th class="cont" width="40%">DataSize</th><th class="cont" width="60%">Data</th></tr>
  <tr class="cont"><td class="cont" width="40%"><code>0</code></td>
  <td class="cont" width="60%">Pointer to a null-terminated string.
     Memory area of <code>strlen(Data)+1</code> bytes is alocated. The data is then copied to the
     allocated space.
  </td></tr>
  <tr class="cont"><td class="cont" width="40%"><code>&lt;= sizeof(DWORD)</code></td>
  <td class="cont" width="60%">
  Character array of 4 or less elements or any pointer (<code>HWND</code> window handle, for example).
  No memory is allocated. Data is placed in the local area of the list item.
  </td></tr>
  <tr class="cont"><td class="cont" width="40%"><code>&gt; sizeof(DWORD)</code></td>
  <td class="cont" width="60%">Arbitrary data.
  Memory area of <var>DataSize</var> bytes is allocated.
  The data is then copied to the allocated space.
  </td></tr>
</table>
</div>

<div class=see>See also:</div><div class=seecont>
<a  href="farlist.html">FarList</a>,
<a href="../dmsg/dm_listgetdata.html">DM_LISTGETDATA</a>,
<a href="../dmsg/dm_listsetdata.html">DM_LISTSETDATA</a>,
<a href="../../delphi/tfarlistitemdata.html">TFarListItemData</a>,
<a href="../../structures/index.html">Structures</a>
</div>

</body>
</html>